﻿//using Microsoft.AspNetCore.Builder;
//using Microsoft.Extensions.DependencyInjection;
//using System;
//using System.Collections.Generic;
//using System.Linq;

//namespace SingleBlog.Framework
//{
//    using Core.Data;
//    using Microsoft.AspNetCore.Identity;
//    using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
//    using Microsoft.AspNetCore.Mvc;
//    using Microsoft.AspNetCore.Mvc.Razor;
//    using Microsoft.AspNetCore.Routing;
//    using Microsoft.Extensions.Configuration;
//    using UI;
//    using UI.Filters;

//    public static class SingleBlogAspNetCoreExtension
//    {
//        public static IServiceCollection AddSingleBlog(this IServiceCollection services)
//            => services.AddSingleBlog<SingleBlogDbContext, SingleBlogUser, SingleBlogRole, int>(null);

//        public static IServiceCollection AddSingleBlog<TContext,TUser,TRole,TKey>(this IServiceCollection services,
//            Action<IdentityOptions> identityOptions
//            )
//            where TContext:IdentityDbContext<TUser,TRole, TKey>
//            where TUser : IdentityUser<TKey>
//            where TRole:IdentityRole<TKey>
//            where TKey:IEquatable<TKey>
//        {
//            var configuration = services.BuildServiceProvider().GetRequiredService<IConfiguration>();
            
//            services.AddIdentity<TUser, TRole>(identityOptions)                
//                .AddEntityFrameworkStores<TContext>();
            
//            services.AddMvc();
//            services.ConfigureAll<MvcOptions>(option =>
//            {
//                option.Filters.Add(typeof(InstallationCheckAttribute));
//                option.Filters.Add(typeof(SiteCloseAttribute));
//            });

//            return services;
//        }

//        public static IApplicationBuilder UseSingleBlog(this IApplicationBuilder app)
//        {
//            app.UseMiddleware<InstallationMiddleware>();
//            return app;
//        }
        
        
//    }
//}
